package com.heima.car_platform;

import java.util.ArrayList;

public class CarRentalCompany implements RentalCompany {
    private ArrayList<Car> inputCar;
    private ArrayList<Car> outputCar;

    public CarRentalCompany(ArrayList<Car> inputCar, ArrayList<Car> outputCar) {
        this.inputCar = inputCar;
        this.outputCar = outputCar;
    }

    @Override
    public void addCar(Car car) {
        inputCar.add(car);
        System.out.println("收车"+car.getBrand());
    }

    @Override
    public void displayCars() {
        for (int i = 0; i < inputCar.size(); i++) {
            Car c = inputCar.get(i);
            c.input();
        }

    }

    @Override
    public void rentCar(Car car) {
        outputCar.add(car);
        System.out.println("租车"+car.getBrand());
    }

    @Override
    public void returnCar() {
        for (int i = 0; i < inputCar.size(); i++) {
            Car c = inputCar.get(i);
            c.output();
        }
    }
}
